package client_gui;

import java.awt.BorderLayout;
import java.awt.Container;
import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JButton;
import javax.swing.JLabel;

import client_controllers.EmployeeLoginController;
import client_controllers.MaintainAreaController;
import client_controllers.MarketingManagerController;

import java.awt.Color;

import javax.swing.JTextField;
import javax.swing.JComboBox;

public class MaintainAreaGUI extends JFrame {

	private JPanel contentPane;
	private JButton btnBack;
	private JButton btnAddArea;
	private JButton btnDeleteArea;
	private JButton btnLogout;
	private JButton btnCreateArea;
	private JTextField areaIdtextField;
	private JTextField areaNametextfield;
	private JPanel panel1;
	private JPanel paneladd;
	private JLabel lblerror;
	private JLabel lblSelectAreaId;
	private JPanel paneldelete;
	private JComboBox areacomboBox;
	private JButton btnDelete;
	private JLabel lblAreaDeletedSuccessfully;

	public MaintainAreaGUI(MarketingManagerController mmc,EmployeeLoginController elc) {
		setBounds(100, 100, 450, 351);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane.setLayout(null);
		
		panel1 = new JPanel();
		panel1.setBounds(0, 0, 434, 79);
		contentPane.add(panel1);
		panel1.setLayout(null);
		
		btnBack = new JButton("Back");
		btnBack.setBounds(335, 11, 89, 23);
		panel1.add(btnBack);
		
		btnLogout = new JButton("Logout");
		btnLogout.setBounds(335, 45, 89, 23);
		panel1.add(btnLogout);
		
		JLabel lblChooseOperation = new JLabel("Choose Operation");
		lblChooseOperation.setForeground(new Color(0, 0, 255));
		lblChooseOperation.setBounds(109, 0, 120, 29);
		panel1.add(lblChooseOperation);
		
		btnAddArea = new JButton("Add Area");
		btnAddArea.setBounds(49, 40, 89, 23);
		panel1.add(btnAddArea);
		
		btnDeleteArea = new JButton("Delete Area");
		btnDeleteArea.setBounds(160, 40, 106, 23);
		panel1.add(btnDeleteArea);
		
		paneladd = new JPanel();
		paneladd.setVisible(false);
		paneladd.setBounds(0, 78, 434, 134);
		contentPane.add(paneladd);
		paneladd.setLayout(null);
		
		JLabel lblAddArea = new JLabel("Add Area");
		lblAddArea.setForeground(new Color(0, 0, 255));
		lblAddArea.setBounds(70, 0, 75, 19);
		paneladd.add(lblAddArea);
		
		JLabel lblNewAreaId = new JLabel("New Area ID:");
		lblNewAreaId.setBounds(10, 30, 81, 14);
		paneladd.add(lblNewAreaId);
		
		areaIdtextField = new JTextField();
		areaIdtextField.setBounds(128, 27, 86, 20);
		paneladd.add(areaIdtextField);
		areaIdtextField.setColumns(10);
		
		JLabel lblNewAreaName = new JLabel("New Area Name:");
		lblNewAreaName.setBounds(10, 70, 106, 14);
		paneladd.add(lblNewAreaName);
		
		areaNametextfield = new JTextField();
		areaNametextfield.setBounds(128, 67, 86, 20);
		paneladd.add(areaNametextfield);
		areaNametextfield.setColumns(10);
		
		btnCreateArea = new JButton("Create Area");
		btnCreateArea.setBounds(59, 101, 112, 23);
		paneladd.add(btnCreateArea);
		
		lblerror = new JLabel("Missing Fields");
		lblerror.setVisible(false);
		lblerror.setForeground(new Color(255, 0, 0));
		lblerror.setBounds(237, 40, 154, 36);
		paneladd.add(lblerror);
		
		paneldelete = new JPanel();
		paneldelete.setVisible(false);
		paneldelete.setBounds(0, 78, 434, 134);
		contentPane.add(paneldelete);
		paneldelete.setLayout(null);
		
		lblSelectAreaId = new JLabel("Select Area ID To Delete");
		lblSelectAreaId.setForeground(new Color(0, 0, 255));
		lblSelectAreaId.setBounds(47, 11, 151, 14);
		paneldelete.add(lblSelectAreaId);
		
		areacomboBox = new JComboBox();
		areacomboBox.setBounds(47, 36, 125, 20);
		paneldelete.add(areacomboBox);
		
		btnDelete = new JButton("Delete");
		btnDelete.setBounds(67, 67, 89, 23);
		paneldelete.add(btnDelete);
		
		lblAreaDeletedSuccessfully = new JLabel("Area Deleted Successfully");
		lblAreaDeletedSuccessfully.setVisible(false);
		lblAreaDeletedSuccessfully.setForeground(new Color(0, 0, 255));
		lblAreaDeletedSuccessfully.setBounds(211, 54, 151, 23);
		paneldelete.add(lblAreaDeletedSuccessfully);
		setVisible(true);
		MaintainAreaController mac=new MaintainAreaController(this, mmc, elc);
	}
	public JLabel getLblAreaDeletedSuccessfully() {
		return lblAreaDeletedSuccessfully;
	}
	public void setLblAreaDeletedSuccessfully(JLabel lblAreaDeletedSuccessfully) {
		this.lblAreaDeletedSuccessfully = lblAreaDeletedSuccessfully;
	}
	public JButton getBtnDelete() {
		return btnDelete;
	}
	public void setBtnDelete(JButton btnDelete) {
		this.btnDelete = btnDelete;
	}
	public JComboBox getAreacomboBox() {
		return areacomboBox;
	}
	public void setAreacomboBox(JComboBox areacomboBox) {
		this.areacomboBox = areacomboBox;
	}
	public JLabel getLblerror() {
		return lblerror;
	}
	public void setLblerror(JLabel lblerror) {
		this.lblerror = lblerror;
	}
	public JPanel getPaneladd() {
		return paneladd;
	}
	public void setPaneladd(JPanel paneladd) {
		this.paneladd = paneladd;
	}
	public JButton getBtnBack() {
		return btnBack;
	}

	public void setBtnBack(JButton btnBack) {
		this.btnBack = btnBack;
	}

	public JButton getBtnAddArea() {
		return btnAddArea;
	}

	public void setBtnAddArea(JButton btnAddArea) {
		this.btnAddArea = btnAddArea;
	}

	public JButton getBtnDeleteArea() {
		return btnDeleteArea;
	}

	public void setBtnDeleteArea(JButton btnDeleteArea) {
		this.btnDeleteArea = btnDeleteArea;
	}

	public JButton getBtnLogout() {
		return btnLogout;
	}

	public void setBtnLogout(JButton btnLogout) {
		this.btnLogout = btnLogout;
	}

	public JButton getBtnCreateArea() {
		return btnCreateArea;
	}

	public void setBtnCreateArea(JButton btnCreateArea) {
		this.btnCreateArea = btnCreateArea;
	}

	public JTextField getAreaIdtextField() {
		return areaIdtextField;
	}

	public void setAreaIdtextField(JTextField areaIdtextField) {
		this.areaIdtextField = areaIdtextField;
	}

	public JTextField getAreaNametextfield() {
		return areaNametextfield;
	}

	public void setAreaNametextfield(JTextField areaNametextfield) {
		this.areaNametextfield = areaNametextfield;
	}
	public JPanel getPaneldelete() {
		return paneldelete;
	}
	public void setPaneldelete(JPanel paneldelete) {
		this.paneldelete = paneldelete;
	}
}
